<template>
  <el-card>
    <my-table path="course/" :cols="cols" :formObj="form" :tableAttrs="tableAttrs" :rules="rules" :pageSize="pageSize"
      :pageParams="pageParams">
      <template v-slot:form>
        <el-form-item label="课时名" prop="name">
          <el-input v-model="form.name" placeholder="课时名" clearable></el-input>
        </el-form-item>
        <el-form-item label="课时数" prop="classHour">
          <el-input v-model="form.classHour" placeholder="课时数" clearable></el-input>
        </el-form-item>
      </template>
    </my-table>
  </el-card>
</template>

<script>
  import myTable from '../../components/myTable.vue';
  export default {
    components: {
      myTable
    },
    data() {
      return {

        cols: [{
            property: 'name',
            label: '课程名',
          },
          {
            property: 'classHour',
            label: '课时数'
          }
        ],
        tableAttrs: {
          border: true
        },
        form: {
          name: '',
          classHour: '',
        },
        //对话框
        rules: {
          name: [{
            required: true,
            message: '学号必填',
            trigger: 'blur'
          }],
          classHour: [{
            required: true,
            message: '姓名必填',
            trigger: 'blur'
          }],
        },
        pageSize: [10, 20, 30, 50],
        pageParams: {
          limit: 10
        }
      }
    },
  }
</script>

<style>
</style>
